package com.fqgj.sentry.policy.dao;

import com.fqgj.common.base.BaseMapper;
import com.fqgj.sentry.policy.entity.PcPolicyEntity;

import java.util.List;

/**
 * User: yujianfu
 * Date: 2017-07-12
 * Time: 09:37:58.131
 */

public interface PcPolicyDao extends BaseMapper<PcPolicyEntity> {
    /**
     * 执行者下的策略list
     *
     * @param executorId
     * @return
     */
    List<PcPolicyEntity> selectPolicyByExecutorId(Long executorId);

    List<PcPolicyEntity> selectListByPolicySetId(String policySetId);

    /**
     * 策略code 查询
     *
     * @return
     */
    Integer selectMaxCode(Long policySetsId);


    /**
     * 策略code 查询
     *
     * @return
     */
    Integer selectMaxSort(Long policySetsId);


    /**
     * 根据策略集  查询
     *
     * @param policySetId
     * @return
     */
    List<PcPolicyEntity> selectPolicyByPolicySetId(Long policySetId);


    /**
     * 通过 策略集 执行者
     *
     * @param executorId
     * @return
     */
    List<PcPolicyEntity> selectByPolicySetIdAndExecutorId(Long policySetId, Long executorId);

    /**
     * 更新 策略排序
     *
     * @param policyId
     * @param sort
     * @return
     */
    Boolean updatePolicySort(Long policyId, Integer sort);


    void deleteByPolicySetId(Long policySetId);


}